//
//  InptHealthyCell.m
//  掌上宏力
//
//  Created by admin on 2017/5/16.
//  Copyright © 2017年 admin. All rights reserved.
//

#import "InptHealthyCell.h"
#import "InpHealthyModel.h"

static CGFloat Lab_H = 30;

@interface InptHealthyCell ()
/*
 {
 \"DIAGNOSIS_TYPE\": \"1\",
 \"DIAGNOSIS_DESC\": \"1、亚急性甲状腺炎\\r\\n\",
 \"DIAGNOSIS_DATE\": \"2016/11/716: 20: 13\",
 \"DIAGNOSIS_TYPE_NAME\": \"门诊诊断\"
 },
 
 @property (nonatomic,copy) NSString *diagnosisType;
 @property (nonatomic,copy) NSString *diagnosisDesc;
 @property (nonatomic,copy) NSString *diagnosisDate;
 @property (nonatomic,copy) NSString *diagnosisName;
 */
@property (nonatomic,weak) UILabel *typeLab;
@property (nonatomic,weak) UILabel *descLab;
@property (nonatomic,weak) UILabel *dateLab;
@property (nonatomic,weak) UILabel *nameLab;


@end

@implementation InptHealthyCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        UILabel *descLab = [[UILabel alloc] initWithFrame:CGRectMake(LeftDis, 5, kScreenW-LeftDis*2, Lab_H)];
        [self.contentView addSubview:descLab];
        self.descLab = descLab;
        
        UILabel *typeLab= [[UILabel alloc] initWithFrame:CGRectMake(LeftDis, descLab.bottom, 100, Lab_H)];
        typeLab.font = kFont(15);
        [self.contentView addSubview:typeLab];
        self.typeLab = typeLab;
        
        UILabel *nameLab = [[UILabel alloc] initWithFrame:CGRectMake(typeLab.right+10, descLab.bottom, kScreenW-120, Lab_H)];
        nameLab.font = kFont(15);
        [self.contentView addSubview:nameLab];
        self.nameLab = nameLab;
    }
    return self;
}
-(void)setHealthInfo:(InpHealthyModel *)healthInfo{
    self.descLab.text = [NSString stringWithFormat:@"%@",healthInfo.diagnosisDesc];
    self.typeLab.text = [NSString stringWithFormat:@"级别：%@级",healthInfo.diagnosisType];
    self.nameLab.text = [NSString stringWithFormat:@"类型：%@",healthInfo.diagnosisName];
}
+(instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *cellId = @"healthyCell";
    InptHealthyCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId];
    if (cell == nil) {
        cell = [[InptHealthyCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
//    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    return cell;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
